<template>
  <div class="tabContentCategory" v-if="Object.keys(showSubcategories).length !== 0">
    <div class="tabItem" v-for="item in showSubcategories.list" :key="item.acm">
      <a :href="item.link">
        <div class="itemImg"><img :src="item.image" @load="itemImgLoad" :alt="item.title"></div>
        <div class="itemText">{{item.title}}</div>
      </a>
    </div>
  </div>
</template>

<script>
  export default {
    name: "TabContentCategory",
    props: {
      showSubcategories: {
        type: Object,
        default(){
          return {};
        }
      }
    },
    methods: {
      itemImgLoad(){
        this.$emit("itemImgLoad");
      }
    }
  }
</script>

<style scoped>
  .tabContentCategory{
    width: 100%;
    background-color: white;
    display: flex;
    flex-wrap: wrap;
    padding-top: 15px;
  }
  .tabItem{
    width: calc(100% / 3);
    font-size: 12px;
    text-align: center;
    padding: 5px;
  }
  .tabContentCategory .tabItem .itemImg img{
    width: 80%;
    height: 100%;
  }
  .itemText{
    margin-top: 15px;
  }
</style>